import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
} from '@nestjs/common';
import { ConsumptionTypeService } from './consumption-type.service';
import { CreateConsumptionTypeDto } from './dto/create-consumption-type.dto';
import { UpdateConsumptionTypeDto } from './dto/update-consumption-type.dto';

@Controller('consumption-type')
export class ConsumptionTypeController {
  constructor(
    private readonly consumptionTypeService: ConsumptionTypeService,
  ) {}

  @Post()
  create(@Body() createConsumptionTypeDto: CreateConsumptionTypeDto) {
    return this.consumptionTypeService.create(createConsumptionTypeDto);
  }

  @Get()
  findAll() {
    return this.consumptionTypeService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.consumptionTypeService.findOne(+id);
  }

  @Patch(':id')
  update(
    @Param('id') id: string,
    @Body() updateConsumptionTypeDto: UpdateConsumptionTypeDto,
  ) {
    return this.consumptionTypeService.update(+id, updateConsumptionTypeDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.consumptionTypeService.remove(+id);
  }
}
